<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/hpp_c1_c2.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<%@ include file="/common/meta.jsp" %>
<title>VTC - Holistic Programme Planning - HPP</title>
<%@ include file="/common/css_js.jsp"%>

<script type="text/javascript">
	
	var validator;

	$(document).ready(function() {
		validator=$("#mainForm").validate();
	});

	
	function clickBtn(action){
		switch(action){
		case "cancel":
			  CE.close();
			  return;
			  
		case "save":
			var from  = document.getElementById("validationPeriodFrom").value;
			var to  = document.getElementById("validationPeriodTo").value;
			//alert(from.length-4);
			var from_d = Date.parse(from);
			var to_d = Date.parse(to);
			if(from_d > to_d){
				document.getElementById("errorMsgSpan").innerHTML="Validation To should be later then the Validation From, please check.";
				return false;
			}
			 if(validator.form()){
				  $("#mainForm").submit();
				  CE.close();
				  return;				 
			 }
		}
		
	}
</script> 

</head>
<body>

	<div class="bodyBlank">
	  <div class="padding"> <!-- InstanceBeginEditable name="content" -->
	    <div class="pageTitle">HKCAAVQ VAlidation</div>
	    <div class="form2">
	    
		  <span class="errorLabel" id="errorMsgSpan"></span>
		  <s:actionerror/>
		  <s:fielderror/>
		  <s:actionmessage/> 
				  
		  <s:form id="mainForm" name="mainForm" namespace="/programme" 
		  		  action="programme-accreditation!saveHkcaavq.action" validate="true" 
		  		  target="_parent">
		  		  
			<s:hidden name="programmeId"></s:hidden>
			<s:hidden name="code"></s:hidden>
			<s:hidden name="hkcaavqValidation.id"></s:hidden>
			    
	      <table cellspacing="0" cellpadding="0" border="0">
	        <tbody><tr>
	          <td class="sep"><img style="width:180px;" src="../images/spacer.gif"></td>
	          <td class="sep sep2"><img src="../images/spacer.gif"></td>
	        </tr>
	        <tr>
	          <td><label class="fLabel">Area of Study/Training</label>
	            <div class="fField">
		            <s:select cssStyle="width:300px" cssClass="required" name="hkcaavqValidation.areaOfStudy" id="areaOfStudy"
		            		  list="paramService.paaList" listKey="code" listValue="desc"
		            		  headerKey="" headerValue="-- Select --">
		            </s:select> 	              
	            </div></td>
	            <td>&nbsp;</td>
	        </tr>
	        <tr>
	          <td><label class="fLabel">Programme Area </label>
	            <div class="fField">
	              
		            <s:select cssStyle="width:300px" cssClass="required" name="hkcaavqValidation.programmeArea" id="programmeArea"
		            		  list="paramService.subPaaList" listKey="code" listValue="desc"
		            		  headerKey="" headerValue="-- Select --">
		            </s:select> 
		            	              
	            </div></td>
	            <td>&nbsp;</td>
	        </tr>
	        <tr>
	          <td><label class="fLabel">Validation Period </label>
	            <div class="fField"> From
	              <s:textfield cssClass="inputCalendar required" readonly="" maxlength="10" 
	                           name="hkcaavqValidation.validationPeriodFrom" id="validationPeriodFrom"></s:textfield>
	              <b style="font-weight: normal;" class="weekText">&nbsp;</b>             
	            </div></td>
	            
	            <td><label class="fLabel">Validation Period </label>
	            <div class="fField">            
	              To
	              <s:textfield cssClass="inputCalendar required" readonly="" maxlength="10" 
	                           name="hkcaavqValidation.validationPeriodTo" id="validationPeriodTo"></s:textfield>
	              <b style="font-weight: normal;" class="weekText">&nbsp;</b> 	              
	            </div></td>
	        </tr>
	      </tbody></table>
	      <br>
	      <div class="btnSet btnSetTypeB">
	        <div class="left">
	          <div class="button">
	            <div class="left">
	              <div class="right">
	                <input type="button" onclick="clickBtn('save',event)" value="Save" name="" id="" class="inputButton">
	              </div>
	            </div>
	          </div>
	          <div class="button">
	            <div class="left">
	              <div class="right">
	                <input type="button" onclick="clickBtn('cancel',event)" value="Cancel" name="" id="" class="inputButton">
	              </div>
	            </div>
	          </div>
	        </div>
	      </div>
	      </s:form>
	    </div>
	    <!-- InstanceEndEditable --> </div>
	</div>

</body>
</html>   